Skip to content

Combobox: the focus ring is a has rule, the rules' first real use (#443) - #460

Merged
samitbasu merged 2 commits into
mainfrom
rules-use-443
Nov 20, 2026
Merged

samitbasu merged 2 commits into
mainfrom
rules-use-443

Conversation

@samitbasu

Copy link
Copy Markdown
Owner

Part of #443: the rules' first real use, as a proof. Goldens unchanged.

The combobox's box (shadcn's input group) wore its focus ring through its own focus_within variant. It is now has(Match::focus_visible(), |b| b.border_color(..).ring(..)), the form of shadcn's has-[[data-slot=input-group-control]:focus-visible]:ring. The rule reads last frame's focus, so the ring appears a frame after the field takes focus, where the variant drew it in the same frame; nothing else changes.

Test: the_combobox_box_wears_the_focus_ring_while_its_field_has_focus (no ring painted before focus, a ring painted after, through the real draw path). The command-palette, combobox and snapshot tests pass (26) with every golden as it was; clippy and fmt pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AJYxo4YJZUXcPJ1bHdAHKy

samitbasu and others added 2 commits November 20, 2026 11:52
…443)

The combobox's box, shadcn's input group, wore its ring through its own
`focus_within` variant. It is now `has(Match::focus_visible(), ..)`: the
box's border color and ring while a child, the field, has focus, as shadcn's
`has-[[data-slot=input-group-control]:focus-visible]` does. The rule reads
last frame's focus, so the ring follows the focus a frame later.

Behavior changes: none in the goldens; the ring appears a frame after the
field takes focus instead of in the frame it does.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AJYxo4YJZUXcPJ1bHdAHKy
@samitbasu

Copy link
Copy Markdown
Owner Author

Approved by the user on its tests (2026-11-20); the one-frame ring lag accepted. GitHub's required checks pass on the branch merged with current main. Merging.

@samitbasu
samitbasu merged commit 6f3b241 into main Nov 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant